

  let page = 1;
  let line = 8;
  setPage();
   async function setPage(){
       const urlObj = myGetUrlValue();
       console.log(urlObj);
       console.log(urlObj.cat_one_id)

       const res = await myPromiseAjax('../server/goods_list.php' , 'get' , {cat_one_id:urlObj.cat_one_id , page: page , line:line } , 'json');
       console.log(res);
       let str = '';

       res.data.forEach(item => {
        str += `
        
        <li class="list">
        <div class="top">
          <p>
           <span>${item.cat_one_id}&nbsp;&nbsp;&nbsp;/</span>
           <span>${item.cat_two_id}&nbsp;&nbsp;&nbsp;/</span>
           <span>${item.cat_three_id}</span>
          </p>
        </div>
        
        <div class="bottom">
          <div class="imgbody">
            <p>
              <img src="${item.goods_big_logo}" alt="..">
            </p>
          </div>

          
          <div class="name">

            <p class="titleP"><span>${item.goods_name}</span></p>

            <p class="moneyP">
            <b>￥&nbsp; ${item.goods_price}</b>
            </p>

            <p class="clickP">
              <button class="blue"><a href="javascrit:;">查找相似产品</a></button>
              <button class="red"><a href="./detail.html?goods_id=${item.goods_id}">查看商品详情</a></button>
            </p>
          </div>
        </div>
      </li>

       `
        $('ul').html(str);
        $('h1').html(`《狗东自营${item.cat_one_id}》`)
       });
     
       $('.box').pagination({
        pageCount: res.sumPage ,
        totalData: res.row,
        current:res.page,
        showData:res.line,
        prevCls:'prev',
        nextCls:'next',
        prevContent:'上一页',   
        nextContent:'下一页',  
        activeCls:'active',
        mode:'fixed',
        count:4, 
        coping:true,
        keepShowPN:true, 
        homePage:  '首页',
        endPage: '末页' ,
        jump:true,
        isHide:true,
        callback:function(val){
          console.log(111);
          page = val.getCurrent();
          setPage();
        }  
       })
     }
  
   
     